﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using CommunityToolkit.Mvvm.Messaging;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Controls;
using TUlingWpf.Heplers;
using TUlingWpf.Messages;
using TUlingWpf.Services;
using TUlingWpf.Views;

namespace TUlingWpf.ViewModels
{
    public partial class HomeViewModel : ObservableObject
    {
        public UserSession UserSession { get; }

        public HomeViewModel(UserSession userSession)
        {
            UserSession=userSession;
        }

        [RelayCommand]
        private void Navation(int value)
        {
            if (value==4)
            {
                WeakReferenceMessenger.Default.Send(new LogOutMessage(UserSession.CurrentUser));
            }
            else
            {
                WeakReferenceMessenger.Default.Send(new IntMessage(value));
            }
        }
    }
}